[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-player-dev
Subject: RE: [Player-dev] [Helix-Player-dev] CN: Add splay (Atlas310) as Helix
From: "Zhao, Halley" <halley.zhao () intel ! com>
Date: 2007-10-27 1:19:17
Message-ID: 094BCE01AFBE9646AF220B0B3F367AAB01503628 () pdsmsx413 ! ccr ! corp ! intel ! com
[Download RAW message or body]
¡¡¡¡Thanks, commit to Atlas310 & Head
¡¡¡¡
¡¡¡¡I follow the coding style in that file.
¡¡¡¡Maybe we could change the coding style to comply with other module in helix.
¡¡¡¡
¡¡¡¡>-----Original Message-----
¡¡¡¡>From: Greg Wright [mailto:gwright@real.com]
¡¡¡¡>Sent: 2007Äê10Ô 27ÈÕ 1:11
¡¡¡¡>To: Zhao, Halley
¡¡¡¡>Cc: player-dev@helixcommunity.org; Shen, Cathy;
¡¡¡¡>helix-client-dev@helixcommunity.org
¡¡¡¡>Subject: Re: [Player-dev] [Helix-Player-dev] CR: Add splay (Atlas310) as
¡¡¡¡>Helix engine(client core) for Helix dbus-server
¡¡¡¡>
¡¡¡¡>Zhao, Halley wrote:
¡¡¡¡>> ¡¡¡¡Hi Greg:
¡¡¡¡>> ¡¡¡¡You can refer the whole code below (the patch file doesn't express
¡¡¡¡>it well); I think the clntcore_path is freed each time.
¡¡¡¡>> ¡¡¡¡When the client core path is found, there is a "break" from the loop,
¡¡¡¡>then the following code can free it after using.
¡¡¡¡>
¡¡¡¡>OK, the coding style threw me off, I am not use
¡¡¡¡>to looking for {'s where they were and missed
¡¡¡¡>that. I do think that clientcore_path is getting
¡¡¡¡>freed correctly.
¡¡¡¡>
¡¡¡¡>Is the whole dbus code written in that style? If
¡¡¡¡>so, good, if not, we generally follow the style
¡¡¡¡>of the existing code when adding new code.
¡¡¡¡>
¡¡¡¡>
¡¡¡¡>--greg.
¡¡¡¡>
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ if(env_path == NULL || strlen(env_path) == 0)
¡¡¡¡>> {
¡¡¡¡>> ¡¡¡¡ gint i;
¡¡¡¡>> ¡¡¡¡ for(i = 0; possible_helix_paths[i] != NULL; i++)
¡¡¡¡>> {
¡¡¡¡>> ¡¡¡¡ clntcore_path =
¡¡¡¡>g_build_filename(possible_helix_paths[i],
¡¡¡¡>> ¡¡¡¡ "common", "clntcore.so", NULL);
¡¡¡¡>> ¡¡¡¡ if(g_file_test(clntcore_path,
¡¡¡¡>G_FILE_TEST_IS_REGULAR))
¡¡¡¡>> {
¡¡¡¡>> ¡¡¡¡ g_setenv("HELIX_LIBS", possible_helix_paths[i],
¡¡¡¡>TRUE);
¡¡¡¡>> ¡¡¡¡ break;
¡¡¡¡>> ¡¡¡¡ }
¡¡¡¡>> ¡¡¡¡ g_free(clntcore_path);
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ clntcore_path =
¡¡¡¡>g_build_filename(possible_helix_paths[i],
¡¡¡¡>> ¡¡¡¡ "hxmedpltfm.so", NULL);
¡¡¡¡>> ¡¡¡¡ if(g_file_test(clntcore_path,
¡¡¡¡>G_FILE_TEST_IS_REGULAR))
¡¡¡¡>> {
¡¡¡¡>> ¡¡¡¡ g_setenv("HELIX_LIBS", possible_helix_paths[i],
¡¡¡¡>TRUE);
¡¡¡¡>> ¡¡¡¡ break;
¡¡¡¡>> ¡¡¡¡ }
¡¡¡¡>> ¡¡¡¡ g_free(clntcore_path);
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ }
¡¡¡¡>> ¡¡¡¡ }
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ server = helix_dbus_server_new(connection,
¡¡¡¡>on_helix_dbus_server_shutdown);
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ if(server == NULL) {
¡¡¡¡>> ¡¡¡¡ g_error("Could not start Helix DBus Server."
¡¡¡¡>> ¡¡¡¡ "Try manually setting HELIX_LIBS?");
¡¡¡¡>> ¡¡¡¡ exit(1);
¡¡¡¡>> ¡¡¡¡ }
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡ g_debug("helix-dbus-server running against %s", clntcore_path);
¡¡¡¡>> ¡¡¡¡ g_free(clntcore_path);
¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>-----Original Message-----
¡¡¡¡>> ¡¡¡¡>From: Greg Wright [mailto:gwright@real.com]
¡¡¡¡>> ¡¡¡¡>Sent: 2007Äê10Ô 26ÈÕ 1:18
¡¡¡¡>> ¡¡¡¡>To: Zhao, Halley
¡¡¡¡>> ¡¡¡¡>Cc: player-dev@helixcommunity.org; Shen, Cathy;
¡¡¡¡>> ¡¡¡¡>helix-client-dev@helixcommunity.org
¡¡¡¡>> ¡¡¡¡>Subject: Re: [Player-dev] [Helix-Player-dev] CR: Add splay
¡¡¡¡>(Atlas310) as
¡¡¡¡>> ¡¡¡¡>Helix engine(client core) for Helix dbus-server
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>+ gchar *clntcore_path;
¡¡¡¡>> ¡¡¡¡> env_path = g_getenv("HELIX_LIBS");
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡> if(env_path == NULL || strlen(env_path) == 0) {
¡¡¡¡>> ¡¡¡¡> gint i;
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡> for(i = 0; possible_helix_paths[i] != NULL; i++) {
¡¡¡¡>> ¡¡¡¡>- gchar *clntcore_path =
¡¡¡¡>> ¡¡¡¡>g_build_filename(possible_helix_paths[i],
¡¡¡¡>> ¡¡¡¡>+ clntcore_path =
¡¡¡¡>g_build_filename(possible_helix_paths[i],
¡¡¡¡>> ¡¡¡¡> "common", "clntcore.so", NULL);
¡¡¡¡>> ¡¡¡¡>-
¡¡¡¡>> ¡¡¡¡> if(g_file_test(clntcore_path,
¡¡¡¡>G_FILE_TEST_IS_REGULAR)) {
¡¡¡¡>> ¡¡¡¡> g_setenv("HELIX_LIBS", possible_helix_paths[i],
¡¡¡¡>TRUE);
¡¡¡¡>> ¡¡¡¡>- g_free(clntcore_path);
¡¡¡¡>> ¡¡¡¡> break;
¡¡¡¡>> ¡¡¡¡> }
¡¡¡¡>> ¡¡¡¡>+ g_free(clntcore_path);
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>This is a memory leak. EACH time you call g_build_filename you
¡¡¡¡>> ¡¡¡¡>NEED to call g_free(clntcore_path). Please see:
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>>
¡¡¡¡>>http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Utilit
¡¡¡¡>y
¡¡¡¡>> ¡¡¡¡>-Functions.html#g-build-filename
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>...
¡¡¡¡>> ¡¡¡¡>Returns : a newly-allocated string that must be freed with
¡¡¡¡>g_free().
¡¡¡¡>> ¡¡¡¡>....
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>It looks like it was a memory leak before as well.
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>+ g_debug("helix-dbus-server running against %s",
¡¡¡¡>clntcore_path);
¡¡¡¡>> ¡¡¡¡>+ g_free(clntcore_path);
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>make sure you are not double-free'ing something here. It is hard
¡¡¡¡>> ¡¡¡¡>to tell from the diffs.
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>--greg.
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>
¡¡¡¡>> ¡¡¡¡>Zhao, Halley wrote:
¡¡¡¡>> ¡¡¡¡>> Synopsis:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Add splay as Helix engine for Helix dbus-server
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Helix Client core library name changes to hxmedpltfm.so and
¡¡¡¡>> ¡¡¡¡>> hxmedplyeng.so in Atlas310. update Helix dbus-server to search
¡¡¡¡>> ¡¡¡¡>> hxmedpltfm.so for client core.
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Overview:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Add splay as Helix engine for Helix dbus-server
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Helix Client core library name changes to hxmedpltfm.so and
¡¡¡¡>> ¡¡¡¡>> hxmedplyeng.so in Atlas310. update Helix dbus-server to search
¡¡¡¡>> ¡¡¡¡>> hxmedpltfm.so for client core.
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Files Added:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> No file added
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Files Modified:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> helix-dbus-server-main.cpp:
¡¡¡¡>> ¡¡¡¡>> (player/dbus-server/src/helix-dbus-server-main.cpp)
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> add /usr/lib/helix/splay int the helix engine search list
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> add hxmedpltfm.so as client core for helix engine.
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Image Size and Heap Use impact (Client -Only):
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> little
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Platforms and Profiles Affected:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> platform: linux-2.2-libc6-gcc32-i586
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> profile: helix-client-all-defines
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Distribution Libraries Affected:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> <helix-dbus-server.bin>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Distribution library impact and planned action:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> <None>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Platforms and Profiles Build Verified:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Set BIF branch -> hxdbus_3_1_0_atlas
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Set Target(s) -> dbus_server_with_video
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Set Profile -> helix-client-all-defines
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> System ID -> linux-2.2-libc6-gcc32-i586
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Branch:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> HEAD, hxclient_3_1_0_atlas
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Copyright assignment: <MUST be one of the following statements >
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> 2. Intel has signed and delivered a Joint Copyright
¡¡¡¡>Assignment
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> to RealNetworks, and received acknowledgment that the
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> agreement was received.
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Files Attached:
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> helix-dbus-server-main.cpp.diff
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> ZHAO, Halley (Aihua)
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Email: halley.zhao@intel.com <mailto:aihua.zhao@intel.com>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> Tel: +86(21)61166476
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> iNet: 8821-6476
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> SSG/OTC/UMD
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>>
¡¡¡¡>>----------------------------------------------------------------------
¡¡¡¡>-
¡¡¡¡>> ¡¡¡¡>-
¡¡¡¡>> ¡¡¡¡>>
¡¡¡¡>> ¡¡¡¡>> This body part will be downloaded on demand.
_______________________________________________
Player-dev mailing list
Player-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/player-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic