Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:19:14+00:00 2026-06-12T05:19:14+00:00

I have this function defined: struct heap_validation { size_t num_alloc; size_t num_alloc_sz; struct memory

  • 0

I have this function defined:

struct heap_validation {
    size_t num_alloc;
    size_t num_alloc_sz;
    struct memory *mem;
};
...
bool get_isallocated(struct metadata_record *);

When I call the heap_validation function from hashtable_traverse and print the result, I’ve gotten the following values: 0,255 ,246

void hashtable_traverse(struct metadata_record *metarec,
        struct heap_validation *heap_val) {

    printf("get_isallocated(metarec): %d\n",get_isallocated(metarec));

    bool retrieved = false;
    bool allocated = get_isallocated(metarec);
    if (allocated) {
        heap_val->num_alloc += 1;

I also tried with %d and I get the same result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:19:15+00:00Added an answer on June 12, 2026 at 5:19 am

    It turns out that the function hashtable_traverse, which is the function called by the GLib’s g_hash_table_foreach() to iterate over a GHashTable, expects both the key and value.

    I only had the value and a pointer to user data.

    • metarec is the value.
    • The key should be an address pointer (1st parameter), and heap_val is user data, which is optional in g_hash_table_foreach()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function defined like this: public static void ShowAbout(Point location, bool stripSystemAssemblies
I have this self-defined function in my .bashrc : function ord() { printf '%d'
I have this user defined function. public partial class UserDefinedFunctions { static int i;
I have an inline member function defined under class MyClass int MyClass::myInlineFunction(); This function
I have Javascript function defined in the main index.html file. One part of this
Suppose I have a function defined like this: class Foo() { public: void bar(MyClass*
In an ASP.MVC application, I have a function defined in my _ViewStart.cshtml like this:
I have the following object defined function BusinessUnit(id, name, code) { this.id = ko.observable(id);
I have this struct defined: typedef struct Socket_s { ... SocketConnectFunc Connect; ... }Socket;
I have a type defined like this: struct DynTab_s { int object_count; //other fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.