From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: [PATCH V2 0/2] Cleanup: flexarray taking gc. Date: Thu, 4 Oct 2012 17:18:40 +0100 Message-ID: <1349367522-16695-1-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen Devel Cc: Anthony PERARD , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org This two patches do a bit of cleanup in the memomy managment in libxl, regarding the use of flexarray. The first one modify flexarray_make to take gc as argument and update every user in libxl to pass gc and to not call flexarray_free anymore. The second one does some cleanup only in libxl_json to make it use the gc. Change since v1: - Change order of the two patch to not end up with leaks. - Add a comment on the first patch to tell why it OK to store the gc in the flexarray struct. - Keep the _free functions (libxl__json_object_free and flexarray_free, as they can be used if gc in NOGC. Anthony PERARD (2): libxl: Have flexarray using the GC libxl_json: Use libxl alloc function. tools/libxl/flexarray.c | 48 ++++++++++++++--------- tools/libxl/flexarray.h | 7 +++- tools/libxl/libxl.c | 99 ++++++++++-------------------------------------- tools/libxl/libxl_dm.c | 15 ++------ tools/libxl/libxl_json.c | 93 ++++++++++----------------------------------- tools/libxl/libxl_pci.c | 18 ++------- tools/libxl/libxl_qmp.c | 29 ++------------ 7 files changed, 83 insertions(+), 226 deletions(-) -- Anthony PERARD