coding standards
Hi Wei,
I have a few questions before we chat Tuesday. Per your
instructions, I read the coding standards, which referred me to libxl.h for memory management. They are contradictory, in that the coding standards imply that I should be using internal libxl_*alloc functions, but the memory management section says to do a malloc. I thought someone should know.
I assume I should look for and use the appropriate libxl_*alloc
function.
Also, you mentioned that all libxl functions should take a ctx
(context?) as the first argument. I had looked at several libxl_bitmap* functions (init, test, set, and dispose) which don't, but looking at the alloc code you sent me, I'm not clear on the purpose of the ctx. Perhaps we can go over that in our chat.
Thanks.
Linda
Quoted 6 lines · Linda
Hi Wei,
I have a few questions before we chat Tuesday. Per your instructions, I
read the coding standards, which referred me tolibxl.hfor memory management. They are contradictory, in that the coding standards imply that I should be using internal libxl_*alloc functions, but the memory management section says to do a malloc. I thought someone should know.
They are not contradictory. libxl_*alloc are wrappers to libc's *alloc functions.
I think that section is mostly material for external callers (i.e. from the libxl user's point of view). You're going to work on the library itself so your point of view is a bit different.
Quoted 2 lines
I assume I should look for and use the appropriate libxl_*alloc
function.
Yes.
Quoted 6 lines
Also, you mentioned that all libxl functions should take a ctx
(context?) as the first argument. I had looked at several libxl_bitmap* functions (init, test, set, and dispose) which don't, but looking at the alloc code you sent me, I'm not clear on the purpose of the ctx. Perhaps we can go over that in our chat.
I think I said "usually". There are exceptions. :-)
Yes, ctx means context. The application (libxl user) is going to initialise that context and pass that to libxl public API. Then your public API (the functions that you're going to implement are public APIs) can use that context to do various stuff.
There are many things wrapped in context, but I don't think you really need to care about what they are unless you really need them.
For the time being, you can use the code snippet (libxl_bitmap_alloc) I sent you as skeleton to implement your own functions.
Wei.
Quoted 3 lines
Thanks.
Linda
Will do. Thanks for all the info. L
Sent from my iPhone
Quoted 46 lines · Wei Liu
Quoted 8 lines · Linda
Hi Wei,
I have a few questions before we chat Tuesday. Per your instructions, I
read the coding standards, which referred me tolibxl.hfor memory management. They are contradictory, in that the coding standards imply that I should be using internal libxl_*alloc functions, but the memory management section says to do a malloc. I thought someone should know.They are not contradictory. libxl_*alloc are wrappers to libc's *alloc functions.
I think that section is mostly material for external callers (i.e. from the libxl user's point of view). You're going to work on the library itself so your point of view is a bit different.
Quoted 2 lines
I assume I should look for and use the appropriate libxl_*alloc
function.Yes.
Quoted 5 lines
Also, you mentioned that all libxl functions should take a ctx
(context?) as the first argument. I had looked at several libxl_bitmap* functions (init, test, set, and dispose) which don't, but looking at the alloc code you sent me, I'm not clear on the purpose of the ctx. Perhaps we can go over that in our chat.I think I said "usually". There are exceptions. :-)
Yes, ctx means context. The application (libxl user) is going to initialise that context and pass that to libxl public API. Then your public API (the functions that you're going to implement are public APIs) can use that context to do various stuff.
There are many things wrapped in context, but I don't think you really need to care about what they are unless you really need them.
For the time being, you can use the code snippet (
libxl_bitmap_alloc) I sent you as skeleton to implement your own functions.Wei.
Quoted 3 lines
Thanks.
Linda
Linda,
I do want to remind you that you need to start communicating on the public list and submit some patches. Also some of us are away before the application deadline on the 7th. So things may get tight Regards
Lars
Quoted 52 lines · Linda Jacobson
Will do. Thanks for all the info. L
Sent from my iPhone
Quoted 46 lines · Wei Liu
Quoted 8 lines · Linda
Hi Wei,
I have a few questions before we chat Tuesday. Per your instructions, I
read the coding standards, which referred me tolibxl.hfor memory management. They are contradictory, in that the coding standards imply that I should be using internal libxl_*alloc functions, but the memory management section says to do a malloc. I thought someone should know.They are not contradictory. libxl_*alloc are wrappers to libc's *alloc functions.
I think that section is mostly material for external callers (i.e. from the libxl user's point of view). You're going to work on the library itself so your point of view is a bit different.
Quoted 2 lines
I assume I should look for and use the appropriate libxl_*alloc
function.Yes.
Quoted 5 lines
Also, you mentioned that all libxl functions should take a ctx
(context?) as the first argument. I had looked at several libxl_bitmap* functions (init, test, set, and dispose) which don't, but looking at the alloc code you sent me, I'm not clear on the purpose of the ctx. Perhaps we can go over that in our chat.I think I said "usually". There are exceptions. :-)
Yes, ctx means context. The application (libxl user) is going to initialise that context and pass that to libxl public API. Then your public API (the functions that you're going to implement are public APIs) can use that context to do various stuff.
There are many things wrapped in context, but I don't think you really need to care about what they are unless you really need them.
For the time being, you can use the code snippet (
libxl_bitmap_alloc) I sent you as skeleton to implement your own functions.Wei.
Quoted 3 lines
Thanks.
Linda
Xen Outreachy application
Hi Lars,
I am aware of it. Thank you. I've been having trouble with builds
and git send-emails. The code is written and minimally unit tested. I would love to have it reviewed.
I'm waiting on answers/suggestions from Julien and Wei, who have
been very responsive. They deserve gold stars for their patience with me.
BTW, I hope you don't mind I changed the subject line, so the
developers on the list understand the circumstances.
Thanks,
Linda Jacobson
Quoted 55 lines · Lars Kurth
Linda,
I do want to remind you that you need to start communicating on the public list and submit some patches. Also some of us are away before the application deadline on the 7th. So things may get tight Regards
LarsQuoted 49 lines · Linda Jacobson
Will do. Thanks for all the info. L
Sent from my iPhone
Quoted 43 lines · Wei Liu
Quoted 8 lines · Linda
Hi Wei,
I have a few questions before we chat Tuesday. Per your instructions, I
read the coding standards, which referred me tolibxl.hfor memory management. They are contradictory, in that the coding standards imply that I should be using internal libxl_*alloc functions, but the memory management section says to do a malloc. I thought someone should know.They are not contradictory. libxl_*alloc are wrappers to libc's *alloc functions.
I think that section is mostly material for external callers (i.e. from the libxl user's point of view). You're going to work on the library itself so your point of view is a bit different.
Quoted 2 lines
I assume I should look for and use the appropriate libxl_*alloc
function.Yes.
Quoted 5 lines
Also, you mentioned that all libxl functions should take a ctx
(context?) as the first argument. I had looked at several libxl_bitmap* functions (init, test, set, and dispose) which don't, but looking at the alloc code you sent me, I'm not clear on the purpose of the ctx. Perhaps we can go over that in our chat.I think I said "usually". There are exceptions. :-)
Yes, ctx means context. The application (libxl user) is going to initialise that context and pass that to libxl public API. Then your public API (the functions that you're going to implement are public APIs) can use that context to do various stuff.
There are many things wrapped in context, but I don't think you really need to care about what they are unless you really need them.
For the time being, you can use the code snippet (
libxl_bitmap_alloc) I sent you as skeleton to implement your own functions.Wei.
Quoted 3 lines
Thanks.
Linda