Re: Extremely poor performance crunching random numbers under PIV-FC5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 19, 2006 at 04:16:40PM +0200, BankHacker wrote:
> Jakub, I have tried to do what you propose but the following code is
> throwing an error in execution time:
> 
> ### prueba-3.c ##################################################
> 	#include <stdio.h>
> 	#include <stdlib.h>
> 	#include <fcntl.h>
> 
> 	int bucle_random_r() {
> 		int nRandom;
> 		struct random_data *randomdataState;

This is an uninitialized pointer:

> 		static int buf[32];
> 		time_t seconds;
> 		extern void *memset (void *__s, int __c, size_t __n) __THROW;

Don't do this ^^^, string.h provides prototype.
> 
> 		memset(randomdataState, 0, sizeof(*randomdataState));

And you dereference the uninitialized pointer here ^^^.

Either have
struct random_data randomdataState;
and replace current uses of *randomdataState with randomdataState and
currnet uses of randomdataState with &randomdataState, or initialize
the pointer to an address of some struct random_data.

	Jakub

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux