Search Results

Search found 5789 results on 232 pages for 'smart pointer'.

Page 15/232 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • LLVM: Passing a pointer to a struct, which holds a pointer to a function, to a JIT function

    - by Rusky
    I have an LLVM (version 2.7) module with a function that takes a pointer to a struct. That struct contains a function pointer to a C++ function. The module function is going to be JIT-compiled, and I need to build that struct in C++ using the LLVM API. I can't seem get the pointer to the function as an LLVM value, let alone pass a pointer to the ConstantStruct that I can't build. I'm not sure if I'm even on the track, but this is what I have so far: void print(char*); vector<Constant*> functions; functions.push_back(ConstantExpr::getIntToPtr( ConstantInt::get(Type::getInt32Ty(context), (int)print), /* function pointer type here, FunctionType::get(...) doesn't seem to work */ )); ConstantStruct* struct = cast<ConstantStruct>(ConstantStruct::get( cast<StructType>(m->getTypeByName("printer")), functions )); Function* main = m->getFunction("main"); vector<GenericValue> args; args[0].PointerVal = /* not sure what goes here */ ee->runFunction(main, args);

    Read the article

  • How to assign a value to an pointer-pointer passed in call by reference?

    - by mystify
    I want to achieve something similar to what these guys do here: - (NSUInteger)countForFetchRequest:(NSFetchRequest *)request error:(NSError **)error like you can see, you pass an NSError pointer and that nice method will assign a real NSError object to your pointer in case there is an error. So the cool thing about this is, that the method returns an NSUInteger but can ALSO return an NSError, without having to mess around with ugly and fat arrays or dictionaries. So how could I assign an object to the passed-in error pointer?

    Read the article

  • Initializing and accessing a pointer from an array of pointers

    - by idealistikz
    Suppose I have the following: void **Init(int numElems) { //What is the best way to intialize 'ptrElems' to store an array of void *'s? void **ptrElems = malloc(numElems * sizeof(void *)); return ptrElems; } //What is the best way to return a pointer pointing at the index passed as a parameter? void **GetPtr(void **ptrElems, int index) { void **elem = elems + (index * sizeof(void *)); return elem; } First, what is the best way to intialize 'ptrElems' to store an array of pointers? I use malloc because assigning it to an array will not persist after the end of the function. Second, what is the best way to point to the pointer at the specified index? I tried typecasting the first line of the 'GetPtr' function to ensure proper pointer arithmetic, but I receive the warning, 'initialization from incompatible pointer type'. Is it necessary to typecast?

    Read the article

  • How do you delete a pointer without deleting the data the pointer points to?

    - by Faken
    I have a pointer that points to an array and another pointer referencing the same array. How do i delete any one of those pointers without killing the array such that the second undeleted pointer still works? for example: int* pointer1 = new int [1000]; int* pointer2; pointer2 = pointer1; Now i want to get rid of pointer1, how would i do it such that i can continue to access the array normaly through pointer2?

    Read the article

  • Determining if Memory Pointer is Valid - C++

    - by Jim Fell
    It has been my observation that if free( ptr ) is called where ptr is not a valid pointer to system-allocated memory, an access violation occurs. Let's say that I call free like this: LPVOID ptr = (LPVOID)0x12345678; free( ptr ); This will most definitely cause an access violation. Is there a way to test that the memory location pointed to by ptr is valid system-allocated memory? It seems to me that the the memory management part of the Windows OS kernel must know what memory has been allocated and what memory remains for allocation. Otherwise, how could it know if enough memory remains to satisfy a given request? (rhetorical) That said, it seems reasonable to conclude that there must be a function (or set of functions) that would allow a user to determine if a pointer is valid system-allocated memory. Perhaps Microsoft has not made these functions public. If Microsoft has not provided such an API, I can only presume that it was for an intentional and specific reason. Would providing such a hook into the system prose a significant threat to system security? Situation Report Although knowing whether a memory pointer is valid could be useful in many scenarios, this is my particular situation: I am writing a driver for a new piece of hardware that is to replace an existing piece of hardware that connects to the PC via USB. My mandate is to write the new driver such that calls to the existing API for the current driver will continue to work in the PC applications in which it is used. Thus the only required changes to existing applications is to load the appropriate driver DLL(s) at startup. The problem here is that the existing driver uses a callback to send received serial messages to the application; a pointer to allocated memory containing the message is passed from the driver to the application via the callback. It is then the responsibility of the application to call another driver API to free the memory by passing back the same pointer from the application to the driver. In this scenario the second API has no way to determine if the application has actually passed back a pointer to valid memory.

    Read the article

  • boost::function function pointer to parameters?

    - by high6
    How does boost::function take a function pointer and get parameters from it? I want wrap a function pointer so that it can be validated before being called. And it would be nice to be able to call it like boost::function is with the () operator and not having to access the function pointer member. Wrapper func; func(5); //Yes :D func.Ptr(5) //Easy to do, but not as nice looking

    Read the article

  • Detect pointer arithmetics because of LARGEADDRESSAWARE

    - by Suma
    I would like to switch my application to LARGEADDRESSAWARE. One of issues to watch for is pointer arithmetic, as pointer difference can no longer be represented as signed 32b. Is there some way how to find automatically all instances of pointer subtraction in a large C++ project? If not, is there some "least effort" manual or semi-automatic method how to achieve this?

    Read the article

  • Start a thread using a method pointer

    - by Michael
    Hi ! I'm trying to develop a thread abstraction (POSIX thread and thread from the Windows API), and I would very much like it to be able to start them with a method pointer, and not a function pointer. What I would like to do is an abstraction of thread being a class with a pure virtual method "runThread", which would be implanted in the future threaded class. I don't know yet about the Windows thread, but to start a POSIX thread, you need a function pointer, and not a method pointer. And I can't manage to find a way to associate a method with an instance so it could work as a function. I probably just can't find the keywords (and I've been searching a lot), I think it's pretty much what Boost::Bind() does, so it must exist. Can you help me ?

    Read the article

  • [C++] Start a thread using a method pointer

    - by Michael
    Hi ! I'm trying to develop a thread abstraction (POSIX thread and thread from the Windows API), and I would very much like it to be able to start them with a method pointer, and not a function pointer. What I would like to do is an abstraction of thread being a class with a pure virtual method "runThread", which would be implanted in the future threaded class. I don't know yet about the Windows thread, but to start a POSIX thread, you need a function pointer, and not a method pointer. And I can't manage to find a way to associate a method with an instance so it could work as a function. I probably just can't find the keywords (and I've been searching a lot), I think it's pretty much what Boost::Bind() does, so it must exist. Can you help me ?

    Read the article

  • command&pointer&malloc [closed]

    - by gcc
    input 23 3 4 4 42 n 23 0 9 9 n n n 3 9 9 x //according to input,i should create int pointer arrays. pointer arrays starting from 1 (that is initial arrays is arrays[1].when program sees n ,it must be jumb to arrays 2 expected output arrays[1] 3 4 5 42 arrays[2] 23 0 9 9 arrays[5] 3 9 9 x is stopper n is comman to create new pointer array i am new in this site anyone help me how can i write

    Read the article

  • Initialize void pointer to point to an array

    - by idealistikz
    Suppose I have the following: typedef struct { int itemSize; int count; void *list; } Mystruct; Mystruct *InitStruct(int itemSize, int count) { Mystruct *my = malloc(sizeof(Mystruct)); my->itemSize = itemSize; my->count = count; //What is the best way to initialize list? For example: //my->list = malloc(count * sizeof(void *)); OR //my->list = malloc(count * sizeof(itemSize)); } //The following should return a pointer to the element stored at a given index void *Retrieve(const MyStruct *my, int index) { void *item; //What is the best way to return a pointer to the item at the given index from //my->list? } Mystruct is similar to an array and void *list is supposed to store the elements or pointers to the elements. Mystruct *InitStruct is a function that initializes a Mystruct pointer and void *Retrieve is a function that returns a pointer to the element stored at a given index. First, how should I initialize void* list? Should it hold the actual elements or be an array of pointers pointing to the elements? Second, using the void *Retrieve function, how do I return a pointer to the element stored at a given index in my-list?

    Read the article

  • When is "this" pointer initialized in C++?

    - by skydoor
    Hi I have a question about this pointer, when an object is constructed, when it is initialized? Which means, when can I use it? The virtual table is constructed in the constructor, is the same with this pointer? For example, I have a code like this. The output is 8. Does it mean that before the constructor is entered, this pointer is already initialized? class A{ public: A() { cout<<sizeof(*this);} int i; int *p; }; int main() { A a; } If it is true, what else would happen before the constructor is entered? If it is not true, when is the this pointer initialized?

    Read the article

  • Slow parity initialization of RAID-5 array on HP Smart Array 411 controller

    - by Rob Nicholson
    On 29th October 2011, I built a RAID-5 array using 4 x 146.8GB Seagate SAS ST3146855SS drives running at 15k connected to a PowerEdge R515 with HP Smart Array P411 controller running Windows 2008 (so nothing particularly unusual). I know that parity initialisation of a RAID-5 array can take some time but it's still running after 2.5 weeks which seems a little unusual. I'd previously built another array on the same controller using 4 x 2TB SATA-2 drives and that did take a while to complete but a) I'm sure it was less than 2.5 weeks, b) that array was ~12 times bigger and c) during initialization, the percentrage slowly increased each day. At the moment, the status display for this new 2nd array simply says "Parity Initialization Status: In Progress" and it's said that since the start. It's this lack of change on the status that worries me the most - feels like it's not actually doing anything. Do you think something has gone wrong or am I being unpatient and for some reason, the status not increasing is normal? I kind of expected a much smaller array on faster drives (15k SAS versus 7.5k SATA-2) to build in a few days. This is our primary SAN running StarWind so my "have a play" options are very limited. This 2nd array is currently in use for one small virtual disk so I could shut the target machine down, move the virtual disk to another drive and try rebuilding.

    Read the article

  • Mac Outlook showing all links in smart quotes?

    - by user2727128
    I was given the task of fixing my friend's email today and really don't know what the problem is. When an email is sent from his laptop (Mac) from Outlook the email address link in the signature shows exactly like this: [email protected]<mailto:[email protected]>. Additionally the website link displays like this: www.website.com<http://www.website.com>. And lastly, the image comes through as cid:randomstringofnumbers. When I sent him an email and he sent one back it converted my signature to same weird formatting. Plus, even in the header where it shows our emails, they are displaying the same way: [email protected]<mailto:[email protected]>. And the weirdest thing is that this problem seems to be "compounding". So when I scroll down to the last, most recent email in the thread I see this www.website.com<http://www.website.com> next email shows this: www.website.com<http://www.website.com><http://www.website.com> and the next this: www.website.com<http://www.website.com><http://www.website.com><http://www.website.com> This is happening to the emails too, everywhere. I'm thinking this might be something to do with smart quotes and the auto formatting but I'm not sure. Could this be the problem? And if so how do I fix it?

    Read the article

  • Workstation 7 build 203739 - Capture Movie Mouse Pointer Not Visible

    - by BMIVM
    Hi, I have noticed that whenever I create a Capture Movie, the movie is fine but the mouse pointer is not visible at all. The clicks are on buttons file menus are executed but is hard for a viewer of the capturre movie session to follow the recording smoothly. This was not a problem in previous versions of WorkStation. Is this a bug or is there a setting I can set to see the mouse pointer? Note: VM Tools are installed, Host is Vista Ultimate Edtion SP1, x64 and the guest is a Win XP SP2. Thanks in advance for your help.

    Read the article

  • VMware Workstation 7 build 203739 - Capture Movie Mouse Pointer Not Visible

    - by BMIVM
    Hi, I have noticed that whenever I create a Capture Movie, the movie is fine but the mouse pointer is not visible at all. The clicks are on buttons file menus are executed but is hard for a viewer of the capturre movie session to follow the recording smoothly. This was not a problem in previous versions of WorkStation. Is this a bug or is there a setting I can set to see the mouse pointer? Note: VM Tools are installed, Host is Vista Ultimate Edtion SP1, x64 and the guest is a Win XP SP2. Thanks in advance for your help.

    Read the article

  • How to do this in a smart way

    - by Azzyh
    Hello SO. My websystem im coding with now is integrated from the originally phpBB system. With this i mean when you log on my websystem, you have actually logged into the forum from the login page. Now i came to the "log out" part, and i want to make it smart. Right now its a simply link with logout: <a href="<?php echo BASEDIR; ?>../../ucp.php?mode=logout&sid=<? echo $user->data['session_id']; ?>" style="margin-left: 14px; font-size: 10px;">- Log Out</a> As you see in the link it refers to the forum´s ucp.php?mode=logout, and you need to have the SID variable in it in order to log out right.. anyway.. I want to do this log out part in a smart way, i mean, not so you land on the forum´s "you have now been logged out", i want something maybe like run this page in background when you click, and then it refreshes the current page your on. Or should it be smarter just try to modify the phpbb file ucp.php? I think its hard coded, and not the way I am coding, so thats why i find it abit tricky. Thank you for your answers and examples on how this could be done, in a smart way..

    Read the article

  • Utilities Worldwide Succeed with Oracle Utilities Applications

    - by caroline.yu
    More than 50 utilities worldwide have selected or implemented Oracle Utilities applications in the current fiscal year to date to respond to environmental imperatives, adapt to changing business conditions, meet and exceed customer expectations, implement smart grid components and address operational issues. Customers who have recently selected or implemented Oracle Utilities applications include: Acea Distribuzione, California Water Service Company, City of Winnipeg, Denver Water, Enersource Hydro, GasTerra, Modesto Irrigation District, Rappahannock Electric Cooperative, San Francisco Public Utilities Commission and Western Power. "Around the world, utilities are under pressure to address customer demands, improve environmental quality and comply with regulatory requirements. Oracle Utilities provides a choice of mission-critical applications to deliver tangible business results. Our recent traction in the industry illustrates the solid value we bring to our customers," said Stephan Scholl, senior vice president and general manager, Oracle Utilities.

    Read the article

  • Intel Rapid Storage / Smart Response SSD caching issue

    - by goober
    Background Recently built my own PC. It works! Almost. It's been a while since getting into the guts of these things, so I'm familiar but may be missing something simple. FYI, I don't care about blowing the OS away -- it's brand new and we can go back from scratch as many times as necessary. Goal / Issue I'd like to use the SSD to take advantage of Intel's Smart Response technology (allows the SSD to act as a cache for HDDs) I would like the SSD cache to act as a cache for my HDDs, which I would like to be in a RAID1 array (so I get the speed from the SSD and the redundancy from the RAID1) However, Windows only sees the drive in device manager (not as a drive), so I'm unsure what to do about that. Related: as far as I know, for this to work, the drives all have to be in a single RAID array (i.e. a RAID0 pairing of the SSD and the RAID1 HDD array). However, when attempting this at the BIOS level, I am told there is not enough space for an array. Steps so Far Moved the SSD onto the Intel controller (I'd had it on the Marvel 6.0 controller instead of the Intel controller, so the BIOS was only seeing it in a strange way) Updated the BIOS of the motherboard to the latest version Reinstalled Intel's RST (iRST?) software several times, as some forums reported it working after reinstalling 3 times (which does not inspire confidence). Checked Intel storage: it does see the SSD as a physical, non-RAID device. However, it says no space exists if I try to create an array. Checked the BIOS: it does not show up in the boot order, but is an option that can be selected under boot options. Tried the firmware update for that model. Issue: the firmware CD doesn't detect a drive; maybe the Intel storage controller is making it difficult? moved the ssd to the marvel controller. The firmware update cd appeared to hang while searching for drives. swapped out the SATA cable for the manufacturer's and moved back to the intel storage controller. Noticed at this point that in the Intel RST software, a device DOES show up in addition to the RAID set -- only shown as a "60 GB internal disk". Windows doesn't appear to see it as a drive, but it does still show in device manager. Move SSD to port from 0-3 on MOBO and set SATA mode to IDE (after disconnecting RAID1 config) to allow the firmware update to work. Firmware was already at the latest version. Next Steps ? Components involved ASUS P8Z68-V PRO motherboard (Intel Z68 Chipset) Intel i7 2600k Processor 2 x 1TB 7200 RPM HDDs 64 GB Crucial M4 SSD (M4-CT064M4SSD2) For Reference -- Storage Configuration Intel 3 gbps Intel 3gbps Intel 6gbps Marvel 6gbps +----------+ +----------+ +----------+ +----------+ | | <----+ | | +-+ | | | |----------| | |----------| |-|--------| |----------| | | | | + | | | | | | +----------+ | +--|-------+ +-|--------+ +----------+ | | | + v v | 1 TB HDD 64 GB SSD + +> 1 TB HDD For Reference -- Intel RST (v10.8.0.1003) Screenshot Don't mind the "rebuilding" -- knocked a power cable out at one point; it's doing its job, not an indicator of a bad HDD. Any thoughts? Thanks in advance for any help!

    Read the article

  • Need alternative to Accessibility's "Locate Pointer" to visually highlight the mouse.

    - by fred.bear
    Update: See end of quetion: A black-on-white cross-hair/I-bar mouse-pointer is soemtimes hard foe me to spot in amongst black-on-white text. I've tried "Accessibility / Mouse Accessibility / Locate Pointer" .. which will: Show pointer position when Control is presssed It works (to a point), but it does have a notable problem, which renders it inpractical. It has the uncanny side-effect of disallowing all Control key navigation while editing a file/dir name in Nautilus (F2).. Just touching the Control key drops it out of edit mode, which means I can't keyboard paste, move-L/R word etc... So, I'm looking for an alternative. I've tried Compiz's Water Effect, but I need something which is sharper, faster, and localized to the pointer. Compiz's Show Mouse (with fire) is no suitable. I'm really lookingf for an analog of "Accessibility / Locate Pointer": * ie. I hit Control (only).. and it blips a quick visual pulse. UPDATE: I've just realized why I can't find my mouse so often! ... It's because it is isn't there !!! ... Two apps I use a lot, Gedit and Konsole (KDE Terminal; it renders unicode better), ... dissolve the mouse-pointer to invisible after the first key is typed ... and Konsole does it after a few seconds of idle-time... like a video-player option: "hide the mouse".. Well I don't use the mouse much, and I thought it was juse my eyesight (which does rely a lot on Compiz's zoom)... I discovered it when I installed a "novelty" app, called Geyes from gnome-applets ("A goofy set of eyes for the GNOME panel. They follow your mouse.") ... It could follow the mouse better than me! :)

    Read the article

  • Tech Article: Tired of Null Pointer Exceptions? Use Java SE 8's Optional!

    - by Tori Wieldt
    A wise man once said you are not a real Java programmer until you've dealt with a null pointer exception. The null reference is the source of many problems because it is often used to denote the absence of a value. Java SE 8 introduces a new class called java.util.Optional that can alleviate some of these problems. In the tech article "Tired of Null Pointer Exceptions? Use Java SE 8's Optional!" Java expert Raoul-Gabriel Urma shows you how to make your code more readable and protect it against null pointer exceptions. Urma explains "The purpose of Optional is not to replace every single null reference in your codebase but rather to help design better APIs in which—just by reading the signature of a method—users can tell whether to expect an optional value. In addition, Optional forces you to actively unwrap an Optional to deal with the absence of a value; as a result, you protect your code against unintended null pointer exceptions." Learn how to go from writing painful nested null checks to writing declarative code that is composable, readable, and better protected from null pointer exceptions. Read "Tired of Null Pointer Exceptions? Use Java SE 8's Optional!"

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >