On Thu, 29 Jul 2010 15:38:17 +0530, Balbir Singh <[email protected]> 
wrote:
> * Nikunj A. Dadhania <[email protected]> [2010-07-29 11:24:05]:
> > 
> > sizeof(struct cgroup_context_s) returns 820408 bytes. Is this really 
> > intended?
> >
> 
> wow! that is huge, can you please break that down? 

FILENAME_MAX is 4096 bytes, I am using a 64bit system.

struct cg_mount_table_s {
        char name[FILENAME_MAX];
        char path[FILENAME_MAX];
        int index;
};

sizeof (cg_mount_table_s) is 8196 (4096+4096+4)

struct cgroup_context_s {
        /* size of ptr 8 bytes, 100 controllers = 800 */       
        char *cg_namespace[CG_CONTROLLER_MAX]; 
        /* 8196 * 100 = 819600 */
        struct cg_mount_table_s mount[CG_CONTROLLER_MAX];
        /* 4 bytes */
        unsigned size;
};

i.e. 819600 + 800 + 4 = 820404 (dont know why it is 4 bytes less) 

Regards,
Nikunj

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to